package kr.hyunist.androidcomplete01saeildamil.ch08;

import kr.hyunist.androidcomplete01saeildamil.*;
import android.app.*;
import android.os.*;
import android.widget.*;

public class TimerEx extends Activity {
	TextView tv;
	int value = 0;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.timertest);

		tv = (TextView) findViewById(R.id.timertv);
		mHandler.sendEmptyMessage(0);
	}

	Handler mHandler = new Handler() {

		@Override
		public void handleMessage(Message msg) {
			value++;
			tv.setText(value + " Seconds");
			mHandler.sendEmptyMessageDelayed(0, 1000);
		}

	};
}
